package swd.work.generator.v1.java.bean;

import java.io.*;
import java.util.*;

import com.pub.database.*;

import swd.work.generator.v1.java.base.*;

public class ViewBean extends BeanExtend implements BeanImplement {

    public ViewBean(QueryBean pqbnDAO, String pstrUserNO) throws Exception {
        super(pqbnDAO, pstrUserNO);
    }

    /**
     * outputDefaultConstructor
     *
     * @param pbwrPrgNO BufferedWriter
     */
    private void outputConstructor(BufferedWriter pbwrPrgNO) throws Exception {
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "public View(){", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "setMultiLang();", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "setDBProperties();", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
    }

    /**
     * setMutltiLang
     *
     * @param lbwrPrgNO BufferedWriter
     * @param pstrPrgNO String
     */
    private void outputMutltiLang(BufferedWriter pbwrPrgNO, String pstrPrgNO,
                                  String pstrSysNO) throws Exception {
        Hashtable<String,Hashtable<String,Object>> lhtWKF_FRM1 = null;
        Hashtable<String,Object> lhtWKF_FRM1_DATA = null;
        Hashtable<String,Hashtable<String,Object>> lhtWKF_FRM0 = null;
        Hashtable<String,Object> lhtWKF_FRM0_DATA = null;
        int lintLoop_cnt = 0;

        try {
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "private void setMultiLang(){", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "ResourceBundle rbdTitleResource=ResourceBundle.getBundle(\"com\\\\swd\\\\" +
                                 pstrSysNO + "\\\\" + pstrPrgNO +
                                 "\\\\Multi-lang\",Locale.getDefault());", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "try{",
                                 2);

            //Hidden不用輸出多國語言
            lhtWKF_FRM1 = gqbnDAO.hashtableSQL(
                    "select fld_no from wkf_frm1 where prg_no='" + pstrPrgNO +
                    "' and fld_no is not null and rw_mode<>'H' group by fld_no");

            while (lhtWKF_FRM1 != null &&
                   lhtWKF_FRM1.get(String.valueOf(lintLoop_cnt)) != null) {

                lhtWKF_FRM1_DATA = (Hashtable<String,Object>) lhtWKF_FRM1.get(String.valueOf(
                        lintLoop_cnt));

                lintLoop_cnt++;

                super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                     "set" +
                                     lhtWKF_FRM1_DATA.get("FLD_NO").toString() +
                                     "Title(rbdTitleResource.getString(\"" +
                                     lhtWKF_FRM1_DATA.get("FLD_NO").toString() +
                                     "Title\"));", 1);
            }

            lhtWKF_FRM0 = gqbnDAO.hashtableSQL(
                    "select frm_no from wkf_frm0 where prg_no='" + pstrPrgNO +
                    "'");

            lintLoop_cnt = 0;

            while (lhtWKF_FRM0 != null &&
                   lhtWKF_FRM0.get(String.valueOf(lintLoop_cnt)) != null) {
                lhtWKF_FRM0_DATA = (Hashtable<String,Object>) lhtWKF_FRM0.get(String.valueOf(
                        lintLoop_cnt));

                lintLoop_cnt++;

                super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                     "setFrm" +
                                     lhtWKF_FRM0_DATA.get("FRM_NO").toString() +
                                     "Name(rbdTitleResource.getString(\"Frm" +
                                     lhtWKF_FRM0_DATA.get("FRM_NO").toString() +
                                     "Name\"));", 1);
            }
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnAddTitle(rbdTitleResource.getString(\"BtnAddTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnSaveTitle(rbdTitleResource.getString(\"BtnSaveTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnQueryTitle(rbdTitleResource.getString(\"BtnQueryTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnModifyTitle(rbdTitleResource.getString(\"BtnModifyTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnCancelTitle(rbdTitleResource.getString(\"BtnCancelTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnUpdateTitle(rbdTitleResource.getString(\"BtnUpdateTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnApproveTitle(rbdTitleResource.getString(\"BtnApproveTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnRejectTitle(rbdTitleResource.getString(\"BtnRejectTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnDraftTitle(rbdTitleResource.getString(\"BtnDraftTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnExitTitle(rbdTitleResource.getString(\"BtnExitTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnUploadTitle(rbdTitleResource.getString(\"BtnUploadTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnNoteTitle(rbdTitleResource.getString(\"BtnNoteTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setBtnTraceTitle(rbdTitleResource.getString(\"BtnTraceTitle\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setPrgTitle(rbdTitleResource.getString(\"prgTitle\"));",
                                 1);

            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "catch(Exception e){", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "e.printStackTrace();", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
        } catch (Exception e) {
            throw new Exception(e.toString());
        } finally {
            if (lhtWKF_FRM1_DATA != null) {
                lhtWKF_FRM1_DATA.clear();
            }
            if (lhtWKF_FRM1 != null) {
                lhtWKF_FRM1.clear();
            }
            if (lhtWKF_FRM0_DATA != null) {
                lhtWKF_FRM0_DATA.clear();
            }
            if (lhtWKF_FRM0 != null) {
                lhtWKF_FRM0.clear();
            }

            lhtWKF_FRM1_DATA = null;
            lhtWKF_FRM1 = null;
            lhtWKF_FRM0_DATA = null;
            lhtWKF_FRM0 = null;
        }
    }


    /**
     * setPageFieldsVar
     *
     * @param pbwrPrgNO BufferedWriter
     * @param pstrPrgNO String
     */
    private void setPageFieldsVar(BufferedWriter pbwrPrgNO, String pstrPrgNO) throws
            Exception {
        Hashtable<String,Hashtable<String,Object>> lhtWKF_FRM1 = null;
        Hashtable<String,Object> lhtWKF_FRM1_DATA = null;
        int lintWKF_FRM1_cnt = 0;
        String lstrFldType = null;

        try {
            lhtWKF_FRM1 = gqbnDAO.hashtableSQL(
                    "select distinct wkf_frm1.fld_no,wkf_frm1.fld_kind,wkf_layout.wide_dec,wkf_frm1.rw_mode from wkf_frm1,wkf_layout,wkf_frm0 where wkf_frm1.prg_no='" +
                    pstrPrgNO +
                    "' and wkf_frm0.prg_no=wkf_frm1.prg_no and wkf_frm0.frm_no=wkf_frm1.frm_no and wkf_frm0.dbf_no=wkf_layout.dbf_no and wkf_frm1.fld_no=wkf_layout.fld_no and wkf_frm1.fld_no is not null");

            while (lhtWKF_FRM1 != null &&
                   lhtWKF_FRM1.get(String.valueOf(lintWKF_FRM1_cnt)) != null) {

                lhtWKF_FRM1_DATA = (Hashtable<String,Object>) lhtWKF_FRM1.get(String.valueOf(
                        lintWKF_FRM1_cnt));

                lintWKF_FRM1_cnt++;

                lstrFldType = getFldType(lhtWKF_FRM1_DATA.get("FLD_KIND").toString(),lhtWKF_FRM1_DATA.get("WIDE_DEC").toString());

                outputGetterAndSetterCode(pbwrPrgNO, lstrFldType,
                                          lhtWKF_FRM1_DATA.get("FLD_NO").
                                          toString());
                outputGetterAndSetterCode(pbwrPrgNO, "String",
                                          lhtWKF_FRM1_DATA.get("FLD_NO").
                                          toString() + "Title");

                //若設定欄位為SHOW，則永遠為readonly，不用再產生readonly getter and setter
                if(!lhtWKF_FRM1_DATA.get("FLD_KIND").toString().equals("V")){
                    outputGetterAndSetterReadOnlyCode(pbwrPrgNO, "boolean",
                                                      lhtWKF_FRM1_DATA.get("FLD_NO").
                                                      toString());
                }
            }
        } catch (Exception e) {
            throw new Exception(e.toString());
        } finally {
            if (lhtWKF_FRM1_DATA != null) {
                lhtWKF_FRM1_DATA.clear();
            }
            if (lhtWKF_FRM1 != null) {
                lhtWKF_FRM1.clear();
            }

            lhtWKF_FRM1_DATA = null;
            lhtWKF_FRM1 = null;
        }
    }

    public String createBean(String pstrPrgNO) {
        String lstrCreateResult = "";
        String lstrBeanFileName = "View.java";
        BufferedWriter lbwrPrgNO = null;

        try {
            lbwrPrgNO = super.getFwrPrgNO(lstrBeanFileName, "JSP_FRAME_PATH",
                                          "\\com\\swd\\" + getSysNO(gstrUserNO) +
                                          "\\" + pstrPrgNO + "\\",
                                          gstrUserNO);

            super.outputBeanHeader(lbwrPrgNO, super.getSysNO(gstrUserNO),
                                   pstrPrgNO, lstrBeanFileName, gstbTabStr,
                                   gstrTabChar);

            super.setBaseVarible(pstrPrgNO);

            //輸出Default Constructor
            outputConstructor(lbwrPrgNO);

            //輸出AlertMsg,PrgAction,PrgStatus,FlowAction,FlowStatus,FlowNO 等getter and setter
            setCommVarible(lbwrPrgNO);

            setPageFormTitle(lbwrPrgNO,pstrPrgNO);

            //output getter,setter and readonly getter,setter mapping for page fields.
            setPageFieldsVar(lbwrPrgNO, pstrPrgNO);

            //output MultiLang method
            outputMutltiLang(lbwrPrgNO, pstrPrgNO, super.getSysNO(gstrUserNO));

            //output setDBProperties method
            outputDBProperties(lbwrPrgNO);

            //output setMessage method
            outputMessage(lbwrPrgNO,super.getSysNO(gstrUserNO),pstrPrgNO);

            //output set readonly method
            //outputSetFldReadOnly(lbwrPrgNO);

            //output class end single
            super.outputJavaCode(lbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                lbwrPrgNO.flush();
                lbwrPrgNO.close();
                lbwrPrgNO = null;
            } catch (Exception e) {
                System.out.println("cant flush View.java File!!");
                e.printStackTrace();
            }
        }
        
        return lstrCreateResult;
    }

    /**
     * outputDBProperties
     *
     * @param pbwrPrgNO BufferedWriter
     */
    private void outputDBProperties(BufferedWriter pbwrPrgNO) throws Exception {
        try {
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "private void setDBProperties(){", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "ResourceBundle rbdTitleResource=ResourceBundle.getBundle(\"WEB_Config\",Locale.getDefault());",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "try{",
                                 2);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setDBAlias(rbdTitleResource.getString(\"DB_ALIAS\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setDBDebug(Boolean.valueOf(rbdTitleResource.getString(\"DEBUG\")).booleanValue());",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setSourceCharset(rbdTitleResource.getString(\"SOURCE_CHARSET\"));",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "setTargetCharset(rbdTitleResource.getString(\"TARGET_CHARSET\"));",
                                 1);

            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "catch(Exception e){", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "e.printStackTrace();", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "finally{", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "rbdTitleResource=null;", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
        } catch (Exception e) {
            throw new Exception(e.toString());
        }
    }

    /**
     * outputMessage
     *
     * @param pbwrPrgNO BufferedWriter
     */
    private void outputMessage(BufferedWriter pbwrPrgNO,String pstrSysNO,String pstrPrgNO) throws Exception {
        try {
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "public String getMessage(String pstrKey){", 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "return ResourceBundle.getBundle(\"com\\\\swd\\\\"  + pstrSysNO + "\\\\" + pstrPrgNO + "\\\\Multi-lang\",Locale.getDefault()).getString(pstrKey);",
                                 1);
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
        } catch (Exception e) {
            throw new Exception(e.toString());
        }
    }

    /**
     * setPageFormTitle
     *
     * @param lbwrPrgNO BufferedWriter
     * @param pstrPrgNO String
     */
    private void setPageFormTitle(BufferedWriter lbwrPrgNO, String pstrPrgNO) throws Exception {
        Hashtable<String,Hashtable<String,Object>> lhtWKF_FRM1=null;

        try{
            lhtWKF_FRM1=gqbnDAO.hashtableSQL("select frm_no from wkf_frm0 where prg_no='" + pstrPrgNO + "'");

            if(lhtWKF_FRM1==null || lhtWKF_FRM1.get("0")==null){return;}

            for(int i=0;i<lhtWKF_FRM1.size();i++){
                outputGetterAndSetterCode(lbwrPrgNO,"String","Frm" + ((Hashtable<String,Object>)lhtWKF_FRM1.get(String.valueOf(i))).get("FRM_NO") + "Name");
            }
        }
        catch(Exception e){
            e.printStackTrace();
            throw new Exception(e);
        }
        finally{
            if(lhtWKF_FRM1!=null){
                lhtWKF_FRM1.clear();
                lhtWKF_FRM1=null;
            }
        }
    }

    /**
     * outputGetterAndSetterCode
     *
     * @param pbwrPrgNO BufferedWriter 輸出物件
     * @param pstrVarName String 要輸出的getter and setter method name
     */
    public void outputGetterAndSetterCode(BufferedWriter pbwrPrgNO,
                                          String pstrVarType,
                                          String pstrVarName) throws Exception {
        String lstrSimpBeginnerVarType = super.getSimpBeginnerVarType(
                pstrVarType);

        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "private " + pstrVarType + " g" +
                             lstrSimpBeginnerVarType + pstrVarName + ";", 1);

        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "public " + pstrVarType + " get" + pstrVarName +
                             "(){", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "return this.g" + lstrSimpBeginnerVarType +
                             pstrVarName + ";", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);

        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "public void set" + pstrVarName + "(" +
                             pstrVarType + " p" + lstrSimpBeginnerVarType +
                             "Parameter){", 1);
        if (pstrVarType.equals("String")) {
            super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                                 "if(p" + lstrSimpBeginnerVarType +
                                 "Parameter!=null && p" +
                                 lstrSimpBeginnerVarType +
                                 "Parameter.equals(\"null\")){p" +
                                 lstrSimpBeginnerVarType + "Parameter=null;}",
                                 1);
        }
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "this.g" + lstrSimpBeginnerVarType + pstrVarName +
                             "=p" + lstrSimpBeginnerVarType + "Parameter;", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
    }

    /**
     * outputGetterAndSetterCode
     *
     * @param pbwrPrgNO BufferedWriter 輸出物件
     * @param pstrVarName String 要輸出的getter and setter method name
     */
    public void outputGetterAndSetterReadOnlyCode(BufferedWriter pbwrPrgNO,
                                                  String pstrVarType,
                                                  String pstrVarName) throws
            Exception {
        String lstrSimpBeginnerVarType = super.getSimpBeginnerVarType(
                pstrVarType);

        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "private " + pstrVarType + " g" +
                             lstrSimpBeginnerVarType + pstrVarName +
                             "_readonly" + ";", 1);

        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "public " + pstrVarType + " get" + pstrVarName +
                             "_readonly" +
                             "(){", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "return this.g" + lstrSimpBeginnerVarType +
                             pstrVarName + "_readonly;", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);

        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "public void set" + pstrVarName + "_readonly" +
                             "(" +
                             pstrVarType + " p" + lstrSimpBeginnerVarType +
                             "Parameter){", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "try{", 1);
        /*super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                               "if((p" + lstrSimpBeginnerVarType +
         "Parameter!=null && p" + lstrSimpBeginnerVarType +
                "Parameter.toUpperCase().equals(\"READONLY\")) || (p" +
         lstrSimpBeginnerVarType + "Parameter==null || p" +
                               lstrSimpBeginnerVarType +
                               "Parameter.trim().equals(\"\"))){", 1);*/
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "this.g" + lstrSimpBeginnerVarType + pstrVarName +
                             "_readonly=p" + lstrSimpBeginnerVarType +
                             "Parameter;", 1);
        /*super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
         super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "else{", 1);
                 super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                               "throw new Exception(\"set" + pstrVarName +
                               "_readOnly value is not avalible!!\");", 1);
         super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);*/
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "catch(Exception e){", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar,
                             "e.printStackTrace();", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
        super.outputJavaCode(pbwrPrgNO, gstbTabStr, gstrTabChar, "}", 1);
    }

    /**
     * outputCommGetterAndSetter
     */
    public void setCommVarible(BufferedWriter pbwrPrgNO) throws Exception {

        outputGetterAndSetterCode(pbwrPrgNO, "String", "OnloadScript");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "PrgAction");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "PrgStatus");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "FlowAction");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "FlowStatus");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "FlowNO");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "PrgTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "seqno");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "portal");

        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnAddShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnSaveShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnQueryShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnModifyShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnCancelShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnUpdateShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnApproveShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnRejectShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnDraftShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnExitShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnNoteShow");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnTraceShow");

        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnAddTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnSaveTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnQueryTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnModifyTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnCancelTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnUpdateTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnApproveTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnRejectTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnDraftTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnExitTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnUploadTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnNoteTitle");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "BtnTraceTitle");

        outputGetterAndSetterCode(pbwrPrgNO, "String", "DBAlias");
        outputGetterAndSetterCode(pbwrPrgNO, "boolean", "DBDebug");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "SourceCharset");
        outputGetterAndSetterCode(pbwrPrgNO, "String", "TargetCharset");
    }


}
